﻿using System;
using System.Runtime.Serialization;
using PublicDomain.Data.Csv.Metadata;

namespace PublicDomain.Data.Csv
{
    [Serializable]
    public class CsvDataRowException : Exception
    {
        public CsvDataRowException()
            : base()
        {
        }

        public CsvDataRowException(string message, int columnOrdinal)
            : base(message)
        {
            this.ColumnOrdinal = columnOrdinal;
        }

        public CsvDataRowException(string message, Exception innerException, int columnOrdinal)
            : base(message, innerException)
        {
            this.ColumnOrdinal = columnOrdinal;
        }

        protected CsvDataRowException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        public int ColumnOrdinal { get; private set; }
    }
}
